<extend name="Public/common" />
<block name="body">
<div class="page">
  <div class="fixed-bar">
    <div class="item-title">
      <h3>渠道管理</h3>
      <ul class="tab-base">
        	<li><a href="{:U('index')}"><span>列表</span></a></li>
	        <li><a href="{:U('add')}"><span>新增</span></a></li>
	        <li><a href="JavaScript:void(0);" class="current"><span>编辑</span></a></li>
      </ul>
    </div>
  </div>
  <div class="fixed-empty"></div>
  <form id="form1" method="post" name="form1">
    <input type="hidden" name="channel_id" value="{$info['channel_id']}" />
    <table class="table tb-type2">
      <tbody>
      <tr class="noborder">
          <td colspan="2" class="required"><label class="validation" for="channel_name">渠道名称:</label></td>
      </tr>
      <tr class="noborder">
          <td class="vatop rowform"><input type="text" value="{$info['channel_name']}" name="channel_name" id="channel_name" class="txt"></td>
          <td class="vatop tips"></td>
      </tr>
      <tr>
          <td colspan="2" class="required"><label class="validation" for="channel_value">渠道编号值:</label></td>
      </tr>
      <tr class="noborder">
          <td class="vatop rowform">{$info['channel_value']}</td>
          <td class="vatop tips">微信要求的必须整数。 场景值ID，临时二维码时为32位非0整型，永久二维码时最大值为100000（目前参数只支持1--100000）</td>
      </tr>
      <tr>
          <td colspan="2" class="required"><label for="channel_desc">备注说明:</label></td>
      </tr>
      <tr class="noborder">
          <td class="vatop rowform"><textarea name="channel_desc" rows="6" class="tarea" id="channel_desc">{$info['channel_desc']}</textarea></td>
          <td class="vatop tips"><span class="vatop rowform">简单的说明，防止备忘</span></td>
      </tr>
      <tr>
          <td colspan="2" class="required"><label for="channel_desc">二维码:</label></td>
      </tr>
      <tr class="noborder">
          <td class="vatop rowform"><img src="https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket={$info['ticket']}" onload="javascript:DrawImage(this,200,200);"/></textarea></td>
          <td class="vatop tips"><span class="vatop rowform"></span></td>
      </tr>
      </tbody>
        <tfoot>
        <tr class="tfoot">
            <td colspan="15" ><a href="JavaScript:void(0);" class="btn" id="submit"><span>提交</span></a></td>
        </tr>
        </tfoot>
    </table>
  </form>
</div>
    <script src="__JS__/jquery.ajaxContent.pack.js"></script>
    <script type="text/javascript">
        $(document).ready(function(){
            $("#submit").click(function(){
                if($("#form1").valid()){
                    $("#form1").submit();
                }
            });

            $("#form1").validate({
                errorPlacement: function(error, element){
                    error.appendTo(element.parent().parent().prev().find('td:first'));
                },
                rules : {
                    channel_name : {
                        required : true
                    }
                },
                messages : {
                    channel_name : {
                        required : '渠道名称必须填写'
                    }
                }
            });
        });
    </script>
</block>